//
//  Suger.m
//  OC1_类和对象课后作业
//
//  Created by dllo on 15/10/22.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "Suger.h"

@implementation Suger

-(id)init
{

    _name = @"白糖";
    _color = @"白色";
    [self info];
    return self;

}

-(void)info
{

    NSLog(@"%@ %@", _name, _color);

}

-(void)eat
{

    NSLog(@"小明喜欢吃%@的%@", _color, _name);

}

-(id)initWithName:(NSString *)name color:(NSString *)color
{
    
    _name = name;
    _color = color;
    return self;
}


-(NSString *)name
{
    return _name;
}

-(void)setName:(NSString *)name
{
    _name = name;
}
-(NSString *)color
{
    return _color;
}
-(void)setColor:(NSString *)color
{
    _color = color;
}


+(id)sugerWithName:(NSString *)name color:(NSString *)color
{
    Suger *s = [[Suger alloc] initWithName:name color:color];
    return s;
}


@end
